package ce.com.newbluedemo.k2;

import android.app.Application;

import ce.com.cenewbluesdk.proxy.BleFactory;
import ce.com.cenewbluesdk.proxy.CEDevK2Proxy;

/**
 * Created by Administrator on 2016/12/26 0026.
 */

public class K2App extends Application {
    private K2_Handler mk2h;
    private static K2App myApp;

    @Override
    public void onCreate() {
        super.onCreate();

        mk2h=new K2_Handler();
        myApp=this;

        BleFactory.init(this);
        CEDevK2Proxy k2Proxy=BleFactory.getInstance().getK2Proxy();
        BleFactory.getInstance().getK2Proxy().setHandler(mk2h);

    }
    public static K2App getInstance(){
        return myApp;
    }
    public void addBlueListen(K2_Handler.ReceiveBlueDataListen listen){
        mk2h.addReceiveBlueDataListen(listen);
    }
    public void romeveBlueListen(K2_Handler.ReceiveBlueDataListen listen){
        mk2h.removeReceiveBlueDataListen(listen);
    }
}
